[PATCH 4/7] lib-sieve: Switch sieve_max_cpu_time enforcement to time-decayed re-enable
When a user's cumulative CPU time exceeded sieve_max_cpu_time, the
script was permanently disabled. SIEVE_BINARY_FLAG_RESOURCE_LIMIT was
set in the binary header on first overrun and was never cleared by
the resource_usage_timeout decay (which only zeroed the cpu_time
field), so sieve_binary_check_executable() refused execution forever
unless the binary was recompiled or an admin manually wiped the file.
Replace the sticky-flag model with one driven purely by the persisted
cumulative cpu_time, decayed by resource_usage_timeout:
- Drop SIEVE_BINARY_FLAG_RESOURCE_LIMIT and the enum that defined it;
nothing reads sbin->header.flags anymore.
- sieve_binary_check_executable() and sieve_binary_check_resource_usage()
call sieve_resource_usage_is_excessive() on the current cumulative
cpu_time. Raising sieve_max_cpu_time now correctly re-enables a
previously over-limit user without further intervention.
- Gate per-user file persistence on the per-run delta, not the
cumulative total. A refused-without-running attempt has a zero
delta, skips the file write, and leaves update_time at the moment
work was actually consumed. After resource_usage_timeout seconds
of inactivity (or only-trivial deliveries) the next load decays
the cpu_time to zero and the user is allowed to run again.
The on-disk per-user sieve-rusage file format becomes:
V1 <cpu-secs> <update-time>
Gbp-Pq: Name 0004-lib-sieve-Switch-sieve_max_cpu_time-enforcement-to-t.patch